import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from "@dfeidao/atom-web/render/render";
import p001 from './p001';

export default async function a004(fd: IFeidaoAiBrowserComponent) {
	// todo
	const n = fd.data.node.querySelector<HTMLInputElement>('[data-id="plan_list_name"]');
	const v = n.value || '';
	console.log(v);

	const data = get(fd, 'data') as { plan: string; type: string; };

	const res = await nodejs<{ res: Array<{}>; c: number; }>('plan-cb/zj-000006/s001', {
		plan_type_no: data.type,
		plan_cla_attr_no: data.plan,
		pn: 1,
		plan_list_name: v
	});
	render(fd, res, p001, 'p001', 'inner');
}
